<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body{
            height: 3000px;
        }


    </style>
</head>
<body>

    <script>
        console.log(document.documentElement.clientHeight);//获取可视区域的页面的高
        console.log(document.documentElement.clientWidth);//获取可视区域的页面的宽
        
        window.onresize = function(){
            console.log(document.body.clientHeight);
            console.log(document.body.clientWidth);
            //获取整个页面的宽高  包含滚动区域
        }
        window.onscroll = function(){
            console.log(1231231231);
            console.log(document.documentElement.scrollTop);
            //页面卷曲大小（滚动距离）
                
        }

    </script>
    
</body>
</html>